package com.example.education.dao;

import com.example.education.model.Category;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
@Component
public interface CategoryMapper {
    /**
     * 添加种类
     * @param category
     * @return
     */
    Integer insertCategory(@Param("category") Category category);

    /**
     * 删除种类
     * @param categoryId
     * @return
     */
    Integer deleteCategory(@Param("categoryId") Integer categoryId);

    /**
     * 更新种类
     * @param category
     * @return
     */
    Integer updateCategory(@Param("category") Category category);

    /**
     * 查询种类
     * @param categoryId
     * @return
     */
    Category getCategoryById(@Param("categoryId")Integer categoryId);

    /**
     * 查询所有
     * @return
     */
    List<Category> selectAll();
}